<div class="alert-box secondary">
	<h5>Curriculum for <?=$details->level_desc;?></h5>
</div>

<?=$system_message;?>
<div class="panel">
	<?if(!empty($selected)):?>
		<p class="alert-box secondary">Found (<?=count($selected);?>) Subject(s) Assigned to curriculum</p>
			<table style="width:100%;">
				<thead>
					<tr>
						<td>Subject Code</td>
						<td>Learning Areas</td>
						<td>Subject Description</td>
						<td>Subj Order <span data-tooltip class="has-tip" title="Order of the subject on the Report Card DESCENDING 1-..">(?)</span></td>
						<td>&nbsp;</td>
					</tr>
				</thead>
				<tbody>
					<?foreach($selected as $k => $v):?>
						<tr>
							<td><?=$v->subject_name;?></td>
							<td><span class="loading" style="display:inline-block;"></span><input type="text" placeholder="Learning Areas" url="<?=site_url('output/updatelearningareas/'.__link($v->id));?>" class="update-learning-areas" orgval="<?=$v->order;?>" value="<?=$v->learning_areas;?>"style="display:inline-block;width:80%;"></td>
							<td><?=$v->subject_desc;?></td>
							<td><span class="loading" style="display:inline-block;"></span>
								<input url="<?=site_url('output/updatecurriculumorder/'.__link($v->id));?>" class="update-curriculum-order" value="<?=$v->order;?>" type="text" orgval="<?=$v->order;?>" style="display:inline-block;width:50px;">
							</td>
							<td><a href="<?=site_url('room_section_subject/delete_subject_from_curriculum/'.__link($v->id,$level_id));?>" class="confirm btn btn-mini btn-danger" title="Are you sure you want to delete <?=$v->subject_name.' ('.$v->subject_desc.')';?> from current curriculum?">Delete</a></td>
						</tr>
					<?endforeach;?>
				</tbody>
			</table>
	<?else:?>

	
		<div class="alert alert-info">No subjects Selected, please add a subject from the list below.</div>
	<?endif;?>
	
	
</div>
<div class="panel">
	<?if(!empty($subjects)):?>
		<p class="alert-box secondary">Found (<?=count($subjects);?>) Subject(s) unassigned and available.</p>
		<form action="<?=site_url('set-curriculum/'.$level_id.'');?>" method="POST">
			<table style="width:100%;">
				<thead>
					<tr>
						<td>&nbsp;</td>
						<td>Subject Code</td>
						<td>Subject Description</td>
					</tr>
				</thead>
				<tbody>
					<?foreach($subjects as $k => $v):?>
						<tr>
							<td>
								<input id="checkbox<?=$k;?>" class="css-checkbox" type="checkbox" name="subjects[]" value="<?=$v->subj_id;?>">
								<label for="checkbox<?=$k;?>" class="css-label"></label>
							</td>
							<td><?=$v->subj_code;?></td>
							<td><?=$v->subj_desc;?></td>
						</tr>
					<?endforeach;?>
				</tbody>
			</table>
			<input type="submit" name="set_curriculum" value="Set Curriculum" class="btn btn-primary">
		</form>
	<?else:?>
		<div class="notice">No subjects available, please add a subject. <a href="<?=site_url('room_section_subject/add_subject/'.$details->level_id);?>" class="btn btn-mini btn-success">Add Subject</a></div>
	<?endif;?>
</div>

	<a href='<?php echo site_url('curriculum'); ?>' class="btn btn-default">Back</a>

<span id="load" url="<?=image_url('load.gif');?>"></span>
<script type="text/javascript" src="<?php echo script_url('custom/updatecurriculumorder');?>"></script>

